package core;

import domain.AttackTower;
import domain.FreezeTower;
import domain.RapidTower;
import domain.Tower;
import domain.TowerType;

public class TowerGenerator {
	private static TowerGenerator generator = new TowerGenerator();
	public static TowerGenerator getInstance(){
		return generator;
	}
	
	public Tower getTower(int typeStr){
		Tower tower = null;
		TowerType type = TowerType.toTowerType(typeStr);
		if(type.equals(TowerType.ATTACK)){
			tower = new AttackTower();
		}else if(type.equals(TowerType.RAPID)){
			tower = new RapidTower();
		}else if(type.equals(TowerType.FREEZE)){
			tower = new FreezeTower();
		}
		
		return tower;
	}
	
	public Tower getTower(TowerType type){
		Tower tower = null;
		if(type.equals(TowerType.ATTACK)){
			tower = new AttackTower();
		}else if(type.equals(TowerType.RAPID)){
			tower = new RapidTower();
		}else if(type.equals(TowerType.FREEZE)){
			tower = new FreezeTower();
		}
		
		return tower;
	}
}
